home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / query / mquery / mfind.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-05-24  |  4.5 KB  |  169 lines

  1. VERSION 2.00
  2. Begin Form fFind 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Find Record"
  6.    ClientHeight    =   2370
  7.    ClientLeft      =   2025
  8.    ClientTop       =   2625
  9.    ClientWidth     =   5070
  10.    ControlBox      =   0   'False
  11.    Height          =   2835
  12.    Left            =   1935
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2412
  17.    ScaleMode       =   0  'User
  18.    ScaleWidth      =   5160
  19.    Top             =   2250
  20.    Width           =   5250
  21.    Begin ListBox cFieldList 
  22.       BackColor       =   &H00FFFFFF&
  23.       Height          =   1368
  24.       Left            =   240
  25.       TabIndex        =   2
  26.       Tag             =   " OL"
  27.       Top             =   360
  28.       Width           =   1692
  29.    End
  30.    Begin ListBox cOpsList 
  31.       BackColor       =   &H00FFFFFF&
  32.       Height          =   1368
  33.       Left            =   2040
  34.       TabIndex        =   7
  35.       Tag             =   " OL"
  36.       Top             =   360
  37.       Width           =   960
  38.    End
  39.    Begin TextBox cExpr 
  40.       BackColor       =   &H00FFFFFF&
  41.       Height          =   287
  42.       Left            =   3120
  43.       TabIndex        =   1
  44.       Tag             =   " OL"
  45.       Top             =   360
  46.       Width           =   1811
  47.    End
  48.    Begin CheckBox cMatchCase 
  49.       BackColor       =   &H00C0C0C0&
  50.       Caption         =   "Match Case"
  51.       Height          =   252
  52.       Left            =   3120
  53.       TabIndex        =   8
  54.       Top             =   839
  55.       Width           =   1811
  56.    End
  57.    Begin CommandButton OkayButton 
  58.       Caption         =   "&OK"
  59.       Default         =   -1  'True
  60.       Enabled         =   0   'False
  61.       Height          =   372
  62.       Left            =   600
  63.       TabIndex        =   4
  64.       Top             =   1919
  65.       Width           =   1691
  66.    End
  67.    Begin CommandButton CancelButton 
  68.       Cancel          =   -1  'True
  69.       Caption         =   "&Cancel"
  70.       Height          =   372
  71.       Left            =   2879
  72.       TabIndex        =   5
  73.       Top             =   1919
  74.       Width           =   1691
  75.    End
  76.    Begin Label OpsLabel 
  77.       BackColor       =   &H00C0C0C0&
  78.       Caption         =   "Operators:"
  79.       Height          =   192
  80.       Left            =   2039
  81.       TabIndex        =   6
  82.       Top             =   120
  83.       Width           =   971
  84.    End
  85.    Begin Label FieldListLabel 
  86.       BackColor       =   &H00C0C0C0&
  87.       Caption         =   "Fields:"
  88.       Height          =   192
  89.       Left            =   240
  90.       TabIndex        =   3
  91.       Top             =   120
  92.       Width           =   1092
  93.    End
  94.    Begin Label ExprLabel 
  95.       BackColor       =   &H00C0C0C0&
  96.       Caption         =   "Value or Expression:"
  97.       Height          =   192
  98.       Left            =   3120
  99.       TabIndex        =   0
  100.       Top             =   120
  101.       Width           =   1811
  102.    End
  103. Option Explicit
  104. Dim FNotFound As Integer
  105. Sub CancelButton_Click ()
  106.   Hide
  107.   'set the flag for the dynaset/dynagrid form
  108.   gfFindFailed = True
  109. End Sub
  110. Sub cExpr_Change ()
  111.   If cFieldList <> "" And cOpsList <> "" And cExpr <> "" Then
  112.     OkayButton.Enabled = True
  113.   Else
  114.     OkayButton.Enabled = False
  115.   End If
  116. End Sub
  117. Sub cFieldList_Click ()
  118.   If cFieldList <> "" And cOpsList <> "" And cExpr <> "" Then
  119.     OkayButton.Enabled = True
  120.   Else
  121.     OkayButton.Enabled = False
  122.   End If
  123. End Sub
  124. Sub cOpsList_Click ()
  125.   If cFieldList <> "" And cOpsList <> "" And cExpr <> "" Then
  126.     OkayButton.Enabled = True
  127.   Else
  128.     OkayButton.Enabled = False
  129.   End If
  130. End Sub
  131. Sub Form_Load ()
  132.    Me.Left = (screen.Width - Me.Width) / 2
  133.    Me.Top = (screen.Height - Me.Height) / 2
  134.   FNotFound = False
  135.   cOpsList.AddItem "="
  136.   cOpsList.AddItem "<>"
  137.   cOpsList.AddItem ">="
  138.   cOpsList.AddItem "<="
  139.   cOpsList.AddItem ">"
  140.   cOpsList.AddItem "<"
  141.   cOpsList.AddItem "Like"
  142. End Sub
  143. Sub Form_Paint ()
  144.   Outlines Me
  145. End Sub
  146. Sub OkayButton_Click ()
  147.    Dim i As Integer
  148.    On Error GoTo FindErr
  149.    i = cFieldList.ListIndex
  150.    FNotFound = False
  151.    SetHourGlass Me
  152.    gstFindField = cFieldList
  153.    gstFindExpr = cExpr
  154.    gstFindOp = cOpsList
  155.    gfFindMatch = cMatchCase
  156.    Hide
  157.    GoTo FindEnd
  158. FindErr:
  159.    If Err <> EOF_ERR Then
  160.      ShowError
  161.      Resume FindEnd
  162.    Else
  163.      FNotFound = True
  164.      Resume Next
  165.    End If
  166. FindEnd:
  167.    ResetMouse Me
  168. End Sub
  169.